/**
 *
 */
package com.angel.mocks.data.generator.dataGenerator;

import java.util.Collection;

import org.apache.commons.lang.RandomStringUtils;

import com.angel.dao.generic.factory.DAOFactory;
import com.angel.dao.generic.interfaces.GenericDAO;
import com.angel.data.generator.interfaces.DataGenerator;
import com.angel.mocks.data.generator.daos.impl.AddressHibernateDAO;
import com.angel.mocks.data.generator.domainObject.Address;

/**
 * @author William
 *
 */
public class AddressDataGenerator implements DataGenerator{

	private static final long serialVersionUID = -6660041377354830324L;

	public void generateData(Collection<Object> dataCollection, DAOFactory daoFactory) {
		Address address = new Address();
		address.setCity(RandomStringUtils.randomAlphabetic(10));
		address.setName(RandomStringUtils.randomAlphabetic(10));
		address.setNumber(Integer.valueOf(RandomStringUtils.randomNumeric(4)));
		dataCollection.add(address);
	}

	@SuppressWarnings("unchecked")
	public Class<? extends DataGenerator>[] getDependecesGenerators() {
		return (Class<? extends DataGenerator>[]) new Class<?>[]{UserDataGenerator.class, UserTypeDataGenerator.class};
	}

	@SuppressWarnings("unchecked")
	public GenericDAO getGenericDAO() {
		return new AddressHibernateDAO();
	}

	public Class<? extends Object> getDataGeneratorClass() {
		return Address.class;
	}

	public Class<?> thisDataGeneratorClass() {
		return this.getClass();
	}
}
